package com.example.shopping2.a_c_fragment.classa.adapter

import android.graphics.drawable.Drawable
import android.widget.ImageView
import com.bumptech.glide.Glide
import com.bumptech.glide.RequestBuilder
import com.bumptech.glide.request.RequestOptions
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.shopping2.R
import com.example.shopping2.a_c_fragment.classa.entity.ClassRight_Entity

class Right_Adapter(list:ArrayList<ClassRight_Entity.DataBean>):BaseQuickAdapter<ClassRight_Entity.DataBean,BaseViewHolder>(R.layout.class_right,list) {
    override fun convert(holder: BaseViewHolder, item: ClassRight_Entity.DataBean) {
        holder.setText(R.id.right_tex,item.category_name)
        var view = holder.getView<ImageView>(R.id.right_img)

        Glide.with(view.context).load(""+item.category_icon).apply(RequestOptions().error(R.drawable.tt_default_image_error)).into(view)

    }
}